SmartToolkit Plugin Script is tags based script, but it is different from xml or html script.
There is 3 tag type: Tag with parameters, Tag without parameter and Close Tag.
NOTE: Tag Name is not case sensitive, so <head> is same with <HeAD>
SmartToolkit Plugin Script Variables only can be use in parameter.
To define the statement as variable, you need to insert the dollar
prefix $ before name of variable.
You can use any alpha numeric or some other characters for your
variables name. It safe to only use alpha numeric and underscore.
NOTE: The name of variable is case sensitive
SmartToolkit only support 2 variable type ( String and Integer ).
All variables is type juggling, it may automatically change the
current variable type to another type if you use some command.
Example:
<set:$var1,1> This will set $var1 with integer(1)
<set:$var1,$var1+"40"> This will set $var1 with integet(41)
<append:$var," Test"> This will set $var1 wirh string("41 Test")
More Example:
<set:$var1,"abc 40 def 50"> This will set $var1 as string
<set:$var1,$var1+50> This will set $var1 as integer with value 4100
Type juggling String to Integer on SmartToolkit will take the numeric characters and delete the alpha character like on the second example.
Remarks:
There is no absolute range for string variables, it depend with the current phone memory, but for integer variables you can only use the value between
-1000000000 to 1000000000.
Example:
<set:$var,"1234567890"> = string("1234567890")
<set=$var,$var+0> = integer(234567890)
NOTE:
SmartToolkit alwalys take right to left string->integer converter, so be aware if you use the big numeric variable.
There is no absolute boolean type in SmartToolkit. For comparison routine, you can use the alternative value:
You can set the variables values with set tag. The first parameter is variable buffer,
and the second parameter is values which will be set into the variable.
Example:
<set:$var,"Set the string">
<set:$var,400>
Constant values on SmartToolkit not mean Still Values, it more fit if we call it defined values. You cannot change the value by script, but it may change if
current phone state is change.
To define the statement as constants, you need to insert the at sign
prefix @ before name of constants.
Example:
@constant_name
NOTE: The name of Constants / Defined is case sensitive. See the Constants Reference to know all defined constants.
Expressions is manipulation values of tag's parameters. To define the parameter as expressions, you need to insert the prefix (
before the expression statements and postfix ) after the expression statements.
Example:
($statement1+$statement2-@statement3)
($statement1>$statement2)
(($statement1)&&($statement2))
| Example | Name | Result |
|---|---|---|
| $a=$b | Equal | TRUE if $a is equal $b |
| $a==$b | Equal | TRUE if $a is equal $b |
| $a!=$b | Not Equal | TRUE if $a is not equal $b |
| $a!$b | Not Equal | TRUE if $a is not equal $b |
| $a<>$b | Not Equal | TRUE if $a is not equal $b |
| $a<$b | Less than | TRUE if $a is less than $b |
| $a>$b | Greater than | TRUE if $a is greater than $b |
| $a<=$b | Less or equal | TRUE if $a is less or equal than $b |
| $a>=$b | Greater or equal | TRUE if $a is greater or equal than $b |
| Example | Name | Result |
|---|---|---|
| !$a | Not | TRUE if $a is not TRUE. |
| $a && $b | And | TRUE if both $a and $b are TRUE |
| $a & $b | And | TRUE if both $a and $b are TRUE |
| $a || $b | Or | TRUE if either $a or $b is TRUE |
| $a | $b | Or | TRUE if either $a or $b is TRUE |
| $a ^ $b | Xor | TRUE if either $a or $b is TRUE, but not both. |
| Example | Name | Result |
|---|---|---|
| $a + $b | Addition | Sum of $a and $b |
| $a - $b | Subtraction | Difference of $a and $b |
| $a * $b | Multiplication | Product of $a and $b |
| $a / $b | Division | Quotient of $a and $b |
| $a % $b | Modulus | Remainder of $a divided by $b |
| Tags | Function |
|---|---|
| <stkplugin></stkplugin> | Plugins Definition |
| <action></action> | Action callback |
| <main></main> | Main body ( Interface ) |
| Tags | Function |
|---|---|
| <if><else></if> | Comparison |
| <while></while> | Looping [EXPERIMENTAL] |
| <set> | Define the variables |
| <string> | Manipulation string |
| <header> | Set the header informations |
| <getparam> | Get Parameters ( like querys on http ) |
| <reg_get> | Get Registry values into variables |
| <reg_set> | Set Registry values |
| <stringres> | Get SmartToolkit string resource into variable ( in languages file ) |
| Tags | Function |
|---|---|
| <echo> or <print> | Flush the string into screen |
| <button> | Draw the buttons ( action callback or file links ) |
| <link></link> | Define the link ( action callback or file links ) |
| <b></b><i></i><u></u> | Text & Font formatting |
| <hr> | Horizontal line |
| <br> | Break |
| <fontsize> | Set Font size |
| <textcolor> | Set Text Color |
| <bgcolor> | Set Background ( maybe not supporting in full version ) |
| <align> | Set Text align |
| <img> | Show images ( png, bmp, jpg, gif ) |
| <draw> | Drawing something ( value bar, line, trackbar, etc ) |
| Tags | Function |
|---|---|
| <go> | Go to another plugin file file |
| <exec> | Run the application |
| <system> | Start the system functions ( reboot, shutdown, etc ) |
| <sendmessage> | Send messages into window |
| <close> | Close the plugin window |
@true, @false, @APP_VER, @APP_BUILD, @APP_COPY, @APP_COMPANY, @APP_NAME, @APP_LANG, @Mem_TotalPhys, @Mem_AvailPhys, @Mem_MemoryLoad, @ACLineStatus, @BatteryFlag, @BatteryLifePercent @BatteryLifeTime, @BatteryFullLifeTime, @BackupBatteryFlag, @BackupBatteryLifePercent, @BackupBatteryLifeTime, @BackupBatteryFullLifeTime, @BatteryVoltage, @BatteryCurrent, @BatteryAverageCurrent, @BatteryAverageInterval, @BatterymAHourConsumed, @BatteryTemperature, @BackupBatteryVoltage, @BatteryChemistry, @Screen_Width, @Screen_Height, @Screen_ClientWidth, @Screen_ClientHeight, @Screen_BarHeight, @Screen_SmallIconWidth, @Screen_SmallIconHeight, @Screen_BigIconWidth, @Screen_BigIconHeight, @Screen_PluginWidth, @Screen_PluginHeight, @Screen_ScrollbarHSize, @Screen_ScrollbarVSize, @SysYear, @SysMonth, @SysDayOfWeek, @SysDay, @SysHour, @SysMinute, @SysSecond, @SysMilliseconds, @LocalYear, @LocalMonth, @LocalDayOfWeek, @LocalDay, @LocalHour, @LocalMinute, @LocalSecond, @LocalMilliseconds